package com.davidk.survey.server.model;

public class QuestionItem {
	private String questionText;
	private String[] validResponse;
	private String parentId;
	private String parentResponse;

	public void setQuestionText(String questionText) {
		this.questionText = questionText;
	}

	public String getQuestionText() {
		return questionText;
	}

	public void setValidResponse(String[] validResponse) {
		this.validResponse = validResponse;
	}

	/**
	 * Each array item represents a valid choice item. If the item starts with
	 * "%%" then the expression is a RegEx; The user may input any text matching
	 * the RegEx.
	 * 
	 * @return
	 */
	public String[] getValidResponse() {
		return validResponse;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	/**
	 * A non-NULL parent [QuestionItem] id indicates that the question is only
	 * valid if the parent QuestionItem is answered.
	 * 
	 * @return
	 */
	public String getParentId() {
		return parentId;
	}

	public void setParentResponse(String parentResponse) {
		this.parentResponse = parentResponse;
	}

	/**
	 * a non-NULL parent response indicates that the question is only valid if
	 * the parent QuestionItem is answered AND the selected parent answer
	 * matches this value. If parentResponse begins with "%%" then expression is
	 * RegEx.
	 * 
	 * @return
	 */
	public String getParentResponse() {
		return parentResponse;
	}
}
